﻿@using Jqpress.Core.Configuration;
@{
    var siteMap = new XmlSiteMap();
    siteMap.LoadFrom("~/config/sitemap.config");
}

<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>

    <title>@ViewBag.Title</title>

   <meta charset="utf-8" />
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta content="width=device-width, initial-scale=1.0" name="viewport" />
   <meta content="" name="description" />
   <meta content="" name="author" />
   <meta name="MobileOptimized" content="320">
   <!-- BEGIN GLOBAL MANDATORY STYLES -->          
   <link href="/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
   <link href="/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
   <link href="/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
   <!-- END GLOBAL MANDATORY STYLES -->
   <!-- BEGIN PAGE LEVEL STYLES -->
   <link rel="stylesheet" type="text/css" href="/assets/plugins/select2/select2_conquer.css" />
   <link rel="stylesheet" href="/assets/plugins/data-tables/DT_bootstrap.css" />
   <!-- END PAGE LEVEL STYLES -->
   <!-- BEGIN THEME STYLES --> 
   <link href="/assets/css/style-conquer.css" rel="stylesheet" type="text/css"/>
   <link href="/assets/css/style.css" rel="stylesheet" type="text/css"/>
   <link href="/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
   <link href="/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
   <link href="/assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
   <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"/>
   <!-- END THEME STYLES -->
   <link rel="shortcut icon" href="favicon.ico" />
      <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
   <!-- BEGIN CORE PLUGINS -->   
   <!--[if lt IE 9]>
   <script src="/assets/plugins/respond.min.js"></script>
   <script src="/assets/plugins/excanvas.min.js"></script> 
   <![endif]-->   
   <script src="/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
   <script src="/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script> 
   <script src="/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
   <script src="/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
   <script src="/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
   <script src="/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>  
   <script src="/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
   <script src="/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>
   <!-- END CORE PLUGINS -->
   <!-- BEGIN PAGE LEVEL PLUGINS -->
   <script type="text/javascript" src="/assets/plugins/data-tables/DT_bootstrap.js"></script>
   <!-- END PAGE LEVEL PLUGINS -->
   <!-- BEGIN PAGE LEVEL SCRIPTS -->
   <script type="text/javascript" src="/assets/scripts/app.js"></script>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
   <!-- BEGIN HEADER -->   
   <div class="header navbar navbar-inverse navbar-fixed-top">
      <!-- BEGIN TOP NAVIGATION BAR -->
      <div class="header-inner">
         <!-- BEGIN LOGO -->  
         <a class="navbar-brand" href="@Url.Action("index", "home")">
          @Jqpress.Core.Configuration.SiteConfig.GetSetting().SiteName
         </a>
         
         <!-- END LOGO -->
         <!-- BEGIN RESPONSIVE MENU TOGGLER --> 
         <a href="javascript:;" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
         <img src="/assets/img/menu-toggler.png" alt="" />
         </a> 
         <!-- END RESPONSIVE MENU TOGGLER -->
         <!-- BEGIN TOP NAVIGATION MENU -->
         <ul class="nav navbar-nav pull-right">
            <!-- BEGIN NOTIFICATION DROPDOWN -->
           
            <!-- END NOTIFICATION DROPDOWN -->
            <!-- BEGIN INBOX DROPDOWN -->
            
            <!-- END INBOX DROPDOWN -->
            <!-- BEGIN TODO DROPDOWN -->
           
            <!-- END TODO DROPDOWN -->
            <!-- BEGIN USER LOGIN DROPDOWN -->
            <li class="dropdown user">
               <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
               <span class="username">@Jqpress.Core.Common.AdminPage.CurrentUser.UserName</span>
               <i class="icon-angle-down"></i>
               </a>
               <ul class="dropdown-menu">
                  <li><a href="/admin"><i class="icon-key"></i>退出</a></li>
               </ul>
            </li>


            <!-- END USER LOGIN DROPDOWN -->
         </ul>
         <!-- END TOP NAVIGATION MENU -->
      </div>
      <!-- END TOP NAVIGATION BAR -->
   </div>
   <!-- END HEADER -->
   <div class="clearfix"></div>
   <!-- BEGIN CONTAINER -->
   <div class="page-container">
      <!-- BEGIN SIDEBAR -->



      <div class="page-sidebar navbar-collapse collapse">
         <!-- BEGIN SIDEBAR MENU -->        

         <ul class="page-sidebar-menu">
           
            <li>
               <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
               <div class="sidebar-toggler"></div>
               <div class="clearfix"></div>
               <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
            </li>

            @foreach (var item in siteMap.RootNode.ChildNodes.Where(x => x.Visible))
    {
        var liclass = "";
        if (item.ActionName.ToLower() == "index" && item.ControllerName.ToLower() == "home")
        {
            liclass = "start ";
        }
        var controller = ViewContext.RouteData.Values["controller"].ToString().ToLower();
       // controller = (controller == "category" || controller == "tag") ? "post" : controller;
        if (item.ControllerName == controller)
        {
            liclass += "active";
        }
        liclass = liclass.Trim();
        var url = "";
        if (item.ChildNodes.Any(x => x.Visible))
        {
            url = "javascript:;";
        }
        else
        {
            url = Url.Action(item.ActionName, item.ControllerName);
        }
        <li class="@liclass">
               <a href="@url">
               <i class="@item.Icon"></i> 
               <span class="title">@item.Title</span>
                @if (item.ControllerName == ViewContext.RouteData.Values["controller"].ToString().ToLower() && item.ActionName == ViewContext.RouteData.Values["action"].ToString().ToLower())
                {
                    <span class="selected"></span>     
                }
                @if (item.ChildNodes.Any(x => x.Visible)) 
                {
                    if (liclass.IndexOf("active")>-1)
                    {
                     <span class="arrow open"></span>                                    
                    }
                    else {
                     <span class="arrow"></span>                                    
                    }
                }
               </a>
               @if (item.ChildNodes.Any(x => x.Visible))
               {
                <ul class="sub-menu">
                   @foreach (var childitem in item.ChildNodes)
                   {
                       url = Url.Action(childitem.ActionName, childitem.ControllerName);
                       var childliclass = "";
                       if (childitem.ControllerName == ViewContext.RouteData.Values["controller"].ToString().ToLower() && childitem.ActionName == ViewContext.RouteData.Values["action"].ToString().ToLower())
                       {
                           childliclass = "class=active";
                       }
                       
                   <li @childliclass><a href="@url">@childitem.Title</a></li>

                   }
               </ul>
               }
         </li>
    }
        
         </ul>
         <!-- END SIDEBAR MENU -->
      </div>
      <!-- END SIDEBAR -->
      <!-- BEGIN PAGE -->
      <div class="page-content">
         <!-- BEGIN PAGE CONTENT-->
            @RenderBody()
         <!-- END PAGE CONTENT-->
      </div>
      <!-- END PAGE -->
   </div>
   <!-- END CONTAINER -->
   <!-- BEGIN FOOTER -->
   <div class="footer">
      <div class="footer-inner">
      <span id="footer-thankyou">感谢使用 <a href="http://www.jqpress.com/">jqpress</a> 进行创作。</span> |
        <a href="http://www.jqpress.com/">官方文档</a> | <a href="http://www.jqpress.com/">反馈</a>
         2013 &copy; Jqpress
      </div>
      <div class="footer-tools">
         <span class="go-top">
         <i class="icon-angle-up"></i>
         </span>
      </div>
   </div>
    
   <!-- END FOOTER -->

    <script type="text/javascript">
        jQuery(document).ready(function () {
            App.init();
        });

          
   </script>
</body>
<!-- END BODY -->
</html>
